import os

count = 0
def writePng(l):
	global count
	l = l.replace('\n', '')
	
	f = open("pngs/"+str(count)+".png", "wb")
	p = l.decode("hex")
	f.write(p)
	f.close()
	print "pngF", count
	count += 1


con = open("hexValue.txt", "r").readlines()
for l in con:
	if len(l) > 0:
		if l[:8] == "89504e47":
			#writePng(l)
			pass
		else:
			if len(l) > 512:
				print l
				break


